package com.zmn.oms.services.impl.quotation3;

import com.zmn.oms.model.entity.quotation3.OrderFault;
import com.zmn.oms.persistence.interfaces.quotation3.OrderFaultDao;
import com.zmn.oms.services.interfaces.quotation3.OrderFaultService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author sunlife
 * @date:2021/12/2 11:33 上午
 * description:
 */
@Service
public class OrderFaultServiceImpl implements OrderFaultService {

    @Resource
    OrderFaultDao orderFaultDao;

    @Override
    public void insertList(List<OrderFault> faultList) {
        orderFaultDao.batchInsert(faultList);
    }

    @Override
    public List<OrderFault> listByOrderId(Long orderId) {
        return orderFaultDao.listByOrderId(orderId);
    }

    @Override
    public int deleteByOrderIdAndFaultIds(Long orderId, List<Integer> faultIds) {
        return orderFaultDao.deleteByOrderIdAndFaultIds(orderId, faultIds);
    }

    @Override
    public int deleteByOrderId(Long orderId) {
        return orderFaultDao.deleteByOrderId(orderId);
    }

    @Override
    public int update(OrderFault orderFault) {
        return orderFaultDao.updateByPrimaryKeySelective(orderFault);
    }
}
